const { BaseCommand } = require("./base");

class CompareCommand extends BaseCommand {
    async execute() {
        const lhs = this.selfData.lhs;
        const rhs = this.selfData.rhs;
        let ret = {};
        if (!lhs) {
            ret = rhs;
        } else {
            for (const key in rhs) {
                if (rhs[key] !== lhs[key]) {
                    ret[key] = rhs[key];
                }
            }
        }
        return ret;
    }
}

module.exports = {
    CompareCommand,
};
